package com.shishuo.cms.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.shishuo.cms.entity.UserEntity;

@Repository("userDao")
public interface UserDao  extends IBaseDAO<UserEntity, Long>{

	UserEntity getSingleUser(String userName);

	int updateUserStatus(@Param("id") long id, @Param("status") int status);

	int delUsers(Integer[] userIds);

	boolean existUser(String userName);

	void updateUserPassword(@Param("id") long id,@Param("passWord") String passWord);

	UserEntity getSingleUserByEmail(@Param("email") String email);
	
	int updateAddUserMoney(@Param("id") long userId,@Param("userMoney") double userMoney);
	int updateAddUserGold(@Param("id") long userId,@Param("userGold") double userGold);

	List<UserEntity> getAllListByReferName(@Param("referUserName") String referUserName, @Param("offset") long offset,
			@Param("rows") long rows);

	long getAllListCountByReferName(@Param("referUserName") String referUserName);

	List<UserEntity> getMyActiveUserListByReferName(@Param("centerUserName") String centerUserName,
			@Param("offset") long offset,
			@Param("rows") long rows) throws DataAccessException;

	long getMyActiveUserListCountByReferName(@Param("centerUserName") String centerUserName)throws DataAccessException;
	
	UserEntity getParentUserByUserId(@Param("id") long id);

	void updateUserExchangePassword(@Param("id") long id,@Param("chargePassWord") String chargePassWord) throws DataAccessException;

	void updateAddForzenUserMoney(@Param("id")  long userId,@Param("frozenMoney") double outputMoney) throws DataAccessException;
	
}
